<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    {include file="common/cssInfo" /}
    <script type="text/javascript" charset="utf-8" src="__ADMIN__/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__ADMIN__/ueditor/ueditor.all.min.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="__ADMIN__/ueditor/lang/zh-cn/zh-cn.js"></script>


    <title>添加页</title>
</head>

<body>
    <header>
        {include file="common/nav" /}
    </header>
    <main>
        <div class="main-container container-fluid">
            <div class="page-container">
                <!-- 侧边栏 -->
                {include file="common/sidebar" /}

                <!-- Page Content -->
                <div class="page-content">
                    <!-- Page Breadcrumb -->
                    <div class="page-breadcrumbs">
                        <ul class="breadcrumb">
                            <li>
                                <a href="#">系统</a>
                            </li>
                            <li>
                                <a href="{:url('lst')}">文章</a>
                            </li>
                            <li class="active">修改文章</li>
                        </ul>
                    </div>
                    <!-- /Page Breadcrumb -->

                    <!-- Page Body -->
                    <div class="page-body">

                        <div class="row">
                            <div class="col-lg-12 col-sm-12 col-xs-12">
                                <div class="widget">
                                    <div class="widget-header bordered-bottom bordered-blue">
                                        <span class="widget-caption">修改文章</span>
                                    </div>
                                    <div class="widget-body">
                                        <div id="horizontal-form">
                                            <form class="form-horizontal" role="form" action="" method="post" enctype="multipart/form-data">
                                                <input type="hidden" name="id" placeholder="" value="{$artres.id}" />
                                                <div class="form-group">
                                                    <label for="username" class="col-sm-2 control-label no-padding-right">标题</label>
                                                    <div class="col-sm-6">
                                                        <input class="form-control" id="title" placeholder="" name="title"
                                                            required="" type="text" value="{$artres.title}">
                                                    </div>
                                                    <p class="help-block col-sm-4 red">* 必填</p>
                                                </div>

                                                <div class="form-group">
                                                    <label for="username" class="col-sm-2 control-label no-padding-right">作者</label>
                                                    <div class="col-sm-6">
                                                        <input class="form-control" id="author" placeholder="" name="author"
                                                            required="" type="text" value="{$artres.author}">
                                                    </div>
                                                    <p class="help-block col-sm-4 red">* 必填</p>
                                                </div>

                                                <div class="form-group">
                                                    <label for="username" class="col-sm-2 control-label no-padding-right">关键词</label>
                                                    <div class="col-sm-6">
                                                        <input class="form-control" id="keywords" placeholder="" name="keywords"
                                                            required="" type="text" value="{$artres.keywords}">
                                                    </div>
                                                    <p class="help-block col-sm-4 red">* 必填</p>
                                                </div>


                                                <div class="form-group">
                                                    <label for="username" class="col-sm-2 control-label no-padding-right">描述</label>
                                                    <div class="col-sm-6">
                                                        <textarea class="form-control" name="desc" id="desc"">{$artres.desc}</textarea>
                                                    </div>
                                                    <p class="
                                                            help-block col-sm-4 red">* 必填</p>
                                                </div>

                                                <div class="form-group">
                                                    <label for="username" class="col-sm-2 control-label no-padding-right">缩略图</label>
                                                    <div class="col-sm-6">
                                                        <input class="form-control" style="border:0; padding-left: 0;" id="thumb" placeholder="" name="thumb"
                                                            type="file">
                                                            {if condition="$artres['thumb'] == ''"}
                                                            暂无缩略图
                                                            {else /}
                                                            <img src="{$artres.thumb}" alt="" width="30px">
                                                            {/if}
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label for="cateid" class="col-sm-2 control-label no-padding-right">上级栏目</label>
                                                    <div class="col-sm-6">
                                                        <select name="cateid" id="">
                                                            <option value="0">顶级栏目</option>
                                                            {volist name="cateres" id="cate"}
                                                            <option value="{$cate.id}" {if condition="$cate['id'] == $artres['cateid']"}selected="selected"{/if} ><?php echo str_repeat('-',$cate['level']*4) ?>{$cate.catename}</option>
                                                            {/volist}
                                                        </select>
                                                    </div>
                                                    <p class="help-block col-sm-4 red">* 必填</p>
                                                </div>

                                                <div class="form-group">
                                                    <label for="username" class="col-sm-2 control-label no-padding-right">文章内容</label>
                                                    <div class="col-sm-6">
                                                        <!-- 百度富文本编辑器 -->
                                                        <textarea name="content" id="content">{$artres.content}</textarea>
                                                    </div>
                                                    <p class="help-block col-sm-4 red">* 必填</p>
                                                </div>

                                                <div class="form-group">
                                                    <div class="col-sm-offset-2 col-sm-10">
                                                        <button type="submit" class="btn btn-default">修改文章</button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <!-- /Page Body -->
                </div>
                <!-- /Page Content -->
            </div>
        </div>
    </main>

    <!-- 引入js -->
    {include file="common/jsInfo" /}

    <script type="text/javascript">
        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        UE.getEditor('content', {
            initialFrameWidth: 800,
            initialFrameHeight: 400,
        });
    </script>

</body>

</html>